class OliveMagicLight extends Actor
	placeable;

var()  PrimitiveComponent  Mesh;

//var()   LightComponent  LightCom;

//var transient OliveCamera AttachCam;

//var transient bool bAttachToTouchLoc;

var transient OlivePC AttachPC;

var MaterialInterface ShadowDecal;
var MaterialInstanceTimeVarying MITV_Decal;
var vector ShadowDecalLoc;
var rotator ShadowDecalRot;
var float ShadowDecalWidth, ShadowDecalHeight;

var PointLightComponent LightCom;

simulated event PostBeginPlay()
{
	AttachComponent(LightCom);
	//LightCom.SetRotation(Rotation);
	LightCom.SetEnabled(TRUE);
	
	super.PostBeginPlay();
}



function SetShadowDecalParams(vector Loc, rotator Rot, float Width, float Height)
{
	ShadowDecalLoc = Loc;
	ShadowDecalRot = Rot;
	ShadowDecalWidth = Width;
	ShadowDecalHeight = Height;
}

auto state Lighting
{
	function BeginState(Name PreviousStateName)
	{
		if( MaterialInstanceTimeVarying(ShadowDecal) != none )
		{
			MITV_Decal = new(self) class'MaterialInstanceTimeVarying';
			MITV_Decal.SetParent( ShadowDecal );
			WorldInfo.MyDecalManager.SpawnDecal(MITV_Decal, 
				ShadowDecalLoc, ShadowDecalRot, 
				ShadowDecalWidth, ShadowDecalHeight, 
				10.0f, false);
		}
	}

	Function Tick(float DeltaTime)
	{

	}
}


DefaultProperties
{
	Begin Object Class=StaticMeshComponent Name=LightMesh
        StaticMesh=StaticMesh'HU_Mech.SM.S_HU_Mech_SM_Light'
		CastShadow=false
		CollideActors=false
		Scale=1.f
    End Object
    Mesh=LightMesh
    Components.Add(LightMesh)

	Begin Object Class=PointLightComponent Name=Light0
        Radius=400.000000
        Brightness=30.000000
		//InnerConeAngle=30
		//OuterConeAngle=45
        LightColor=(R=255,G=244,B=44,A=255)
        //Translation=(X=16)
        CastShadows=FALSE
        CastStaticShadows=FALSE
        CastDynamicShadows=FALSE
        bForceDynamicLight=FALSE
        bEnabled=FALSE
    End Object
	LightCom=Light0
	Components.Add(LightCom)
	ShadowDecal=MaterialInstanceTimeVarying'WP_FlakCannon.Decals.MITV_WP_FlakCannon_Impact_Decal01' 
}
